package org.muxiao.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.muxiao.seckill.pojo.Order;
import org.muxiao.seckill.pojo.User;
import org.muxiao.seckill.vo.GoodsVo;

/**
 * 订单服务接口
 */
public interface OrderService extends IService<Order> {

    /**
     * 秒杀下单
     * @param user
     * @param goodsVo
     * @return
     */
    Order secKill(User user, GoodsVo goodsVo);

    /**
     * 生成秒杀路径
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 对秒杀路径进行校验
     * @param user
     * @param goodsId
     * @param path
     * @return
     */
    boolean checkPath(User user, Long goodsId, String path);

    /**
     * 验证码校验
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    boolean checkCaptcha(User user, Long goodsId, String captcha);
}
